﻿using RXY_Mall.Application.Goods.Dto;
using RXY_Mall.Core;
using RXY_Mall.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RXY_Mall.Application.Goods
{
    public interface IGoodsService
    {
        #region 商品
        IList<GoodsList> GetAllGoodsByPage(int iDisplayStart, int iDisplayLength, string dateMin, string dateMax, string title, string shopName, string code, string category, int categoryId, int shopId, int status, int type, out int totalCount);

        Task<Response<bool>> SetGoodsIsUse(int manageId, int id, int isUse);
        bool SetGoodsIsNew(int manageId, int id, int isNew);
        bool SetGoodsIsTop(int manageId, int id, int isTop);

        GoodsInput GetGoodsById(int id);

        Task<Response<int>> AddorEditGoods(int managerId, GoodsInput input);
        //商家后台商品列表
        IList<GoodsDto> GetGoodsByPage(int iDisplayStart, int iDisplayLength, string dateMin, string dateMax, string title, string shopName, string code, string category, int categoryId, int shopId, int status, int goodsType,int type, out int totalCount);
        
        #endregion
        Task<int> ResetCategory(int goodsId = 0);
        #region 商品图片
        List<GoodsPictureDto> GetGoodsPictures(int goodsId, int type);

        Task<Response<int>> AddorEditGoodsPictures(int managerId, GoodsPictureInput input);

        #endregion

        #region 商品规格
        List<GoodsSpecDto> GetGoodsSpec(int goodsId);
        SpecWithValueDto GetSpecWithValue(int goodsId);
        Task<Response<int>> DeleteGoodsSpec(int managerId, int goodsId, int specId);
        List<gw_goods_spec> GetSpec();
        Task<Response<int>> AddGoodsSpec(int managerId, int goodsId, int specId);
        Task<Response<int>> AddGoodsSpec(int managerId, int goodsId, string name,string description);
        #endregion

        #region 商品规格值
        List<GoodsSpecValueDto> GetGoodsSpecValue(int goodsId,int specId);
        GoodsSpecValueInput GetGoodsSpecValueById(int id);
        Task<Response<int>> AddorEditGoodsSpecValue(int managerId, GoodsSpecValueInput input);
        Task<Response<int>> DeleteGoodsSpecValue(int id,int goods_id);
        #endregion

        #region 商品SKU
        Task<Response<int>> MakeSku(int id);
        List<GoodsSkuDto> GetGoodsSkuList(int goodsId);
        GoodsSkuDto GetGoodsSkueById(int id);
        IList<GoodsSkuDto> GetGoodsSkuListByPage(int iDisplayStart, int iDisplayLength, int goodsId, out int totalCount);
        SpecSkuDto GetGoodsSpecBySkuCount(int goodsId);
        Task<Response<int>> EditGoodsSku(int managerId, GoodsSkuInput input);
        Task<Response<int>> DeleteSku(int id);
        bool SetGoodsSkuIsUse(int manageId, int id, int isUse);
        Task<Response<int>> BulkUpdateSku(int managerId, int id, string number, int type);
        #endregion

        #region 商品服务
        List<GoodsServiceDto> GetGoodsServiceList();
        
        #endregion

        #region 商品类别
        IList<CategoryDto> GetAllCategoryByPage(int iDisplayStart, int iDisplayLength, string dateMin, string dateMax, string title, int parentId, int type, out int totalCount);
        CategoryInput GetCategoryById(int id);
        Task<Response<int>> AddorEditCategory(int manageId, CategoryInput input);
        bool SetCategoryIsUse(int manageId, int id, int isUse);
        List<CategoryTreeDto> GetCategoryTree(int tid);
        #endregion

        Task<Response<int>> AddSpec(int managerId, int goodsId, string name, string description);
        Task<Response<int>> AddSpecValue(int managerId, int goodsId,int specId,string name,string img);
        int GoodsSkuCount(int id);
        int GetGoodsType(int id);

        #region 商品评论
        IList<CommentDto> GetAllCommentByPage(int iDisplayStart, int iDisplayLength, string dateMin, string dateMax,  int status,out int totalCount, int? shopId = -1);
        bool SetCommentIsUse(int manageId, int id, int isUse);
        #endregion

        #region 品牌
        Response<IPagedList<GetBrandsOutput>> GetBrandsByPage(string brand_name, int brand_status, int page_index = 1, int page_size = 10);
        #endregion
    }
}
